package com.aiit.dao;

import com.aiit.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IUserDao extends BaseMapper<User> {
    @Select("select * from  t_user where deleted=1 and department_id=2 or department_id=1")
    List<User> selectList1();
    @Select("select * from  t_user where deleted=1 and department_id=1")
    List<User> selectList2();
    @Select("select * from  t_user where deleted=1 and department_id=2")
    List<User> selectList3();

    User  queryByUsername(String username);

    List<User> selectList(QueryWrapper<User> queryWrapper,User user);

    List<User> select(User user);


    @Select("insert into t_user_roles(user_id) values (#{user_id})")
    Boolean insert2(int user_id);

    int insert(User user);
}
